<template>
  <!-- 三个部分，title，content，功能按钮 -->
  <!-- 感觉content和功能都要用slot去传递了 -->
  <el-drawer :visible.sync="drawer" :withHeader="false">
    <el-form ref="form" :model="form" label-width="80px"> </el-form>
    <div class="footer">
      <el-button @click="submit" type="primary">确定</el-button>
      <el-button @click="close" type="danger">关闭</el-button>
    </div>
  </el-drawer>
</template>

<script>
import { uploadReviews } from "@/services/student";

export default {
  name: "PopupSidebar",
  data() {
    return {
      drawer: false,
      form: {},
    };
  },
  methods: {
    // close callback

    submit() {
      // console.log("confirm")
      const { student_id } = this.user;
      const { course_id } = this.clickItem;
      uploadReviews(student_id, course_id, this.form);
    },
    close() {
      this.drawer = false;
      this.form = {};
    },
  },
};
</script>

<style lang='less' scoped>

</style>